def func1(param1):
	'''
	This is first function func1
	'''
	# can't use +
	print('in func1: param1=', param1)
	return

# call func1
func1("str1")
func1(123)
func1(123.321)
func1(["a","b","c"])

# 1205

# help() 函数可以打印输出一个函数的文档字符串
help(func1)
help(func1.__doc__)
print('---1')
help(print)
print('---2')
help('print') # 效果同上一个
print('---3')

# 引号嵌套
print('hello, "World!"')
print("hello 'World 2!'")

# 字典使用&打印
dict1 = {1:2, 2:3, 3:4}
print(dict1)

def getPairs(dict):
	'''
	打印数组的k、v，以英文冒号隔开
	'''
	for k,v in dict.items():
		print(k, v, sep=':')

getPairs(dict1)
print('help 4: getPairs')
help(getPairs)

# 引入time模块
import time
print('start sleep')
time.sleep(1)
print('after sleep...')

# 模块信息
# help(time)

# 时间戳：小数
print(time.time())

# 模块下函数的help

help(time.time)

# 字符串转数字
str2 = '2.1'
print('str2=' + str2)
# ValueError: invalid literal for int()
#print('str2 to int=', int(str2))
print('str2 to float=', float(str2))
print('str2 to float to int=', int(float(str2)))


